type Point = { x: number; y: number }

type K = keyof Point

let str:K = 'x'

function getValue(obj, key:string) {
    return obj[key]
}

let obj = {a:1,b:2,c:3}
// type KObj = keyof {a:1,b:2,c:3}
// let k1:KObj = ''

console.log(getValue(obj,'c'))


// function getProp<Type, Key extends keyof Type>(obj: Type, key: Key) {
//     return obj[key]
// }
// let person = { name: 'jack', age: 18 }
// getProp(person, 'age')